package soccer.action;

import java.util.List;
import java.util.Map;

import soccer.model.player.PlayerDAOImpl;
import soccer.model.team.TeamDAOImpl;

public class PlayerActions {
   public List searchPlayerByName(String name , String surname){
	   List playerList = null;
	   PlayerDAOImpl playerDAOImpl = new PlayerDAOImpl();
	   playerList = playerDAOImpl.searchPlayerByName(name, surname);
	   return playerList;
   }
   public List searchPlayerByLicenceNo(int licenceNo){
	   List playerList = null;
	   PlayerDAOImpl playerDAOImpl = new PlayerDAOImpl();
	   playerList = playerDAOImpl.searchPlayerByLicenceNo(licenceNo);
	   return playerList;
   }
   public List searchPlayerByTeam(String teamName){
	   List playerList = null;
	   TeamDAOImpl teamDAOImpl = new TeamDAOImpl();
	   Map team = (Map) teamDAOImpl.searchTeamByName(teamName).get(0);
	   PlayerDAOImpl playerDAOImpl = new PlayerDAOImpl();
	   playerList = playerDAOImpl.searchPlayerByTeam(Integer.parseInt(team.get("teamkodu").toString()));
	   return playerList;
   }
}
